import request from '@/utils/request'

export function page(productId,data) {
    return request({
        url: '/device/all?productId=' + productId,
        method: 'post',
        data
    })
}

export function update(data) {
    return request.post("/device/update", data);
}

export function save(data) {
    return request.post("/device/save", data);
}


export function drop(id) {
    // return  request.post("/depart/delete/"+deptId);
    return request({
        url: "/device/delete?id=" + id,
        method: "post",
    });
}

export function productAll() {
    return request.post("/device/productAll");
}

export function details(id) {
    return request.post("/device/details?id="+id);
}

export function product(id) {
    return request.post("/device/findProduct?id="+id);
}

export function sendInstruction(data) {
    return request.post("/device/instruction",data);
}

export function topic(deviceKey) {
    return request.post("/device/findTopic?deviceKey="+deviceKey);
}

export function findTypeLsit() {
    return request.post("/device-type/findTypeLsit");
}

export function add(data) {
    return request.post("/device/add",data);
}